import axios from '../../axios'

/* 
 * 部门管理模块
 */

// 添加
export const addDept = (data) => {
    return axios({
        url: '/kysj/user/dept/addDept',
        method: 'put',
        data
    })
}
// 编辑
export const updateDept = (data) => {
    return axios({
        url: '/kysj/user/dept/updateDept',
        method: 'post',
        data
    })
}
// 查询部门详情
export const queryDetail = (data) => {
    return axios({
        url: '/kysj/user/dept/queryDetail?deptId='+data,
        method: 'get',
    })
}
// 查询总量
export const count = () => {
    return axios({
        url: '/kysj/user/dept/count',
        method: 'get',
    })
}
// 搜索
export const queryByName = (data) => {
    return axios({
        url: '/kysj/user/dept/findByName?deptName='+ data,
        method: 'get',
    })
}
// 删除
export const deleteDept = (data) => {
    return axios({
        url: '/kysj/user/dept/deleteDept?deptId=' + data,
        method: 'delete',
    })
}
// 查询
export const findAll = () => {
    return axios({
        url: '/kysj/user/dept/findAll',
        method: 'get',
    })
}
// 分页查询
export const findByPage = (page,pageSize) => {
    return axios({
        url: '/kysj/user/dept/findByPage/'+page+'/'+pageSize+'/',
        method: 'get',
    })
}
